//无ID则增加，有ID则更新
def user = session.appUser();
def todayDate = new Date().format('yyyy-MM-dd');

def id = request.getLong('ID');
def content = request.getString('content');

if(id == null){
	db.exec("insert into MONTH (OPEN_ID,DATE) values (?,?)"
			,user.openId
			,todayDate
			);

	id = db.find("select ID from MONTH where OPEN_ID=? and DATE=?",user.openId,todayDate);
	return id;
} else {
	db.exec("update MONTH set CONTENT=? where ID=?",content,id);
	return true;
}